﻿using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Xml.Serialization;
using Landpy.CruiseControlNet.Infrastructure.Control;

namespace Landpy.CruiseControlNet.FacadeInterface.ConfigurationModule
{
    public class RolePermission : Permission
    {
        [Category("Basic")]
        [Description("The name of the role.")]
        [XmlAttribute("name")]
        public string Name { get; set; }

        [Editor(typeof(MultipleTypeCollectionEditor), typeof(UITypeEditor))]
        [Category("Basic")]
        [Description("The users in this role.")]
        [XmlArray("users")]
        [XmlArrayItem("userName", Type = typeof(UserName))]
        public List<UserName> UserNames { get; set; }

        public RolePermission()
            : base(PermissionType.RolePermission)
        {
            this.UserNames = new List<UserName>();
        }
    }
}
